<template>
	<view class="from_item">
		<view v-if="type=='inputs'" :style="`margin-top:${top};min-height:${longT}`" class="cu-form-group">
			<view :style="`color:${nameColor}`" class="title">{{title}}</view>
			<view  :disabled="disable" class="input_item"  name="fSamplespecs" v-model="data" :style="`text-align:${flex};color:${projectName}`" @click="focusTime">{{data ? data : '请选择'}}</view>
		</view>
		
	</view>
</template>

<script>
	export default {
		name: "from-item",
		props: {
			title: {
				type: String,
				default: ''
			},
			flex:{
				type: String,
				default: 'right'
			},
			top: {
				type: String,
				default: ''
			},
			nameColor:{
				type: String,
				default: '#333333'
			},
			projectName :{
				type: String,
				default: '#333333'
			},
			longT:{
				type:String,
				default:""
			},
			num:{
				type:Number,
				default:1
			},
			data: "",
			type: {
				type: String,
				default: 'input'
			},
			disable: {
				type: Boolean,
				default: true
			},
			icon: {
				type: String,
				default: require("../../static/unscope.png")
			},
			isSrc: {
				type: String,
				default: require("../../static/down.png")
			},
			// dataS:{
			// 	type: Array,
			// 	default:function(){
			// 		return []
			// 	}
			// },


		},
		data() {
			return {
				// data:123
				contentShow: false,
			};
		},
		watch:{
			icon(newVal) {
				// console.log(newVal)
				this.icon=newVal
			},
			
			// dataS:{
			// 	handler(val){
			// 		console.log(val)
			// 	},
			// 	deep:true
			// }
			
		},
		methods: {
			// 预览照片
			ViewImage(e) {
				uni.previewImage({
					urls: this.data,
					current: e.currentTarget.dataset.url
				});
			},
			// 控制视频折叠面板
			changeContent() {
				// this.isSrc=""
				this.contentShow = !this.contentShow
			},
			interVideo(src) {
				// console.log(src)
				uni.navigateTo({
					url: '/pages/commonVideo/commonVideo?src=' + src
				});
			},
			focusTime() {
				this.$emit('selectTime')
			}
		}
	}
</script>

<style lang="less" scoped>
	.from_item {
		border-top: 1upx solid #eee;

		.input_item {
			// text-align: right;
			color: #989898 !important;
		}
	}
	
</style>
